

  <!--[if $reportSungmen == "sungmen"]-->
  <table>
    <tr>
       <th width="100%" align="left" rowspan="5"><!--[$district_sungmen]--></th>
    </tr>
  </table>
  <table  width="100%">
    <tr bgcolor="#99CCCC">
      <th width="10%" align="center" rowspan="2">ข้อมูล</th>
      <th width="30%" align="center" colspan="2">ผู้มีสิทธิทั้งหมด</th>
      <th width="20%" align="center" colspan="2">ประชาธิปัตย์</th>
      <th width="20%" align="center" colspan="2">เพื่อไทย</th>
      <th width="20%" align="center" colspan="2">ยังไม่ตัดสินใจ</th>
    </tr>
    <tr bgcolor="#99CCCC">
      <th width="15%" align="center">จำนวน</th>
      <th width="15%" align="center">%</th>
      <th width="10%" align="center">จำนวน</th>
      <th width="10%" align="center">%</th>
      <th width="10%" align="center">จำนวน</th>
      <th width="10%" align="center">%</th>
      <th width="10%" align="center">จำนวน</th>
      <th width="10%" align="center">%</th>
    </tr>
     <!--[foreach from=$objectSungmenArray item=item]-->
      <tr align="right" bgcolor="<!--[cycle values='#FFFFFF,#E8EFF7']-->">
        <td align="left"><!--[$item.name]--></td>
        <td width="15%"><!--[$item.count_sungmen_all]--></td>
        <td width="15%">100</td>
        <td width="10%">
          <a href="<!--[pnmodurl modname='VoteDataCenter' type='remark' func='person' moo=$item.name select='we' tam_id=$tam_id]-->">
          <!--[$item.count_sungmen_we]-->
          </a>
        </td>
          <!--[php]-->
            $item = $this->get_template_vars('item');

            $percent_count_sungmen_we = number_format(($item['count_sungmen_we']*100)/$item['count_sungmen_all'], 2);

            if($percent_count_sungmen_we >=91 && $percent_count_sungmen_we <= 100){
              echo '<td width="10%" bgcolor ="#0099ff" >';
              echo $percent_count_sungmen_we;
              echo '</td>';
            }else if($percent_count_sungmen_we >=71 && $percent_count_sungmen_we < 91){
              echo '<td width="10%" bgcolor ="#33cc00" >';
              echo $percent_count_sungmen_we;
              echo '</td>';
            }else if($percent_count_sungmen_we >=51 && $percent_count_sungmen_we < 71){
              echo '<td width="10%" bgcolor ="#ffffcc" >';
              echo $percent_count_sungmen_we;
              echo '</td>';
            }else if($percent_count_sungmen_we >=1 && $percent_count_sungmen_we < 51){
              echo '<td width="10%" bgcolor ="#ff3300" >';
              echo $percent_count_sungmen_we;
              echo '</td>';
            }else if($percent_count_sungmen_we  < 1){
              echo '<td width="10%" bgcolor ="#ffccff" >';
              echo $percent_count_sungmen_we;
              echo '</td>';
            }
          <!--[/php]-->
        <td width="10%">
          <a href="<!--[pnmodurl modname='VoteDataCenter' type='remark' func='person' moo=$item.name select='they' tam_id=$tam_id]-->">
          <!--[$item.count_sungmen_they]-->
          </a>
        </td>
          <!--[php]-->
            $percent_count_sungmen_they = number_format(($item['count_sungmen_they']*100)/$item['count_sungmen_all'], 2);

            if($percent_count_sungmen_they >=91 && $percent_count_sungmen_they <= 100){
              echo '<td width="10%" bgcolor ="#0099ff" >';
              echo $percent_count_sungmen_they;
              echo '</td>';
            }else if($percent_count_sungmen_they >=71 && $percent_count_sungmen_they < 91){
              echo '<td width="10%" bgcolor ="#33cc00" >';
              echo $percent_count_sungmen_they;
              echo '</td>';
            }else if($percent_count_sungmen_they >=51 && $percent_count_sungmen_they < 71){
              echo '<td width="10%" bgcolor ="#ffffcc" >';
              echo $percent_count_sungmen_they;
              echo '</td>';
            }else if($percent_count_sungmen_they >=1 && $percent_count_sungmen_they < 51){
              echo '<td width="10%" bgcolor ="#ff3300" >';
              echo $percent_count_sungmen_they;
              echo '</td>';
            }else if($percent_count_sungmen_they  < 1){
              echo '<td width="10%" bgcolor ="#ffccff" >';
              echo $percent_count_sungmen_they;
              echo '</td>';
            }
          <!--[/php]-->
        <td width="10%">
          <a href="<!--[pnmodurl modname='VoteDataCenter' type='remark' func='person' moo=$item.name select='unknown' tam_id=$tam_id]-->">
            <!--[$item.count_sungmen_unknown]-->
          </a>
        </td>
          <!--[php]-->
            $percent_unknown = number_format(($item['count_sungmen_unknown']*100)/$item['count_sungmen_all'], 2);

            if($percent_unknown >=91 && $percent_unknown <= 100){
              echo '<td width="10%" bgcolor ="#0099ff" >';
              echo $percent_unknown;
              echo '</td>';
            }else if($percent_unknown >=71 && $percent_unknown < 91){
              echo '<td width="10%" bgcolor ="#33cc00" >';
              echo $percent_unknown;
              echo '</td>';
            }else if($percent_unknown >=51 && $percent_unknown < 71){
              echo '<td width="10%" bgcolor ="#ffffcc" >';
              echo $percent_unknown;
              echo '</td>';
            }else if($percent_unknown >=1 && $percent_unknown < 51){
              echo '<td width="10%" bgcolor ="#ff3300" >';
              echo $percent_unknown;
              echo '</td>';
            }else if($percent_unknown < 1){
              echo '<td width="10%" bgcolor ="#ffccff" >';
              echo $percent_unknown;
              echo '</td>';
            }
          <!--[/php]-->
      </tr>
     <!--[/foreach]-->
      <!--[php]-->
        $sum_count_sungmen_all = $this->get_template_vars('sum_count_sungmen_all');
        $sum_count_sungmen_we = $this->get_template_vars('sum_count_sungmen_we');
        $sum_percent_we = number_format(($sum_count_sungmen_we*100)/$sum_count_sungmen_all, 2);

        $sum_count_sungmen_they = $this->get_template_vars('sum_count_sungmen_they');
        $sum_percent_they = number_format(($sum_count_sungmen_they*100)/$sum_count_sungmen_all, 2);

        $sum_count_sungmen_none_canvasser = $this->get_template_vars('sum_count_sungmen_none_canvasser');
        $sum_none_canvasser = number_format(($sum_count_sungmen_none_canvasser*100)/$sum_count_sungmen_all, 2);

        $sum_count_sungmen_unknown = $this->get_template_vars('sum_count_sungmen_unknown');
        $sum_percent_unknown = number_format((($sum_count_sungmen_unknown*100)/$sum_count_sungmen_all), 2, ".", ",");


        $sum_all_count_sungmen_unknown = $this->get_template_vars('sum_all_count_sungmen_unknown');
        $sum_percent_all_count_sungmen_unknown = number_format((($sum_all_count_sungmen_unknown*100)/$sum_count_sungmen_all), 2, ".", ",");



      <!--[/php]-->
      <tr align="right" bgcolor="<!--[cycle values='#FFFFFF,#E8EFF7']-->">
        <th ><b>รวม</b></td>
        <th><!--[$sum_count_sungmen_all]--></th>
        <th>100</th>
        <th><!--[$sum_count_sungmen_we]--></th>
          <!--[php]-->
            if($sum_percent_we >=91 && $sum_percent_we <= 100){
              echo '<th width="10%" bgcolor ="#0099ff" >';
              echo $sum_percent_we;
              echo '</th>';
            }else if($sum_percent_we >=71 && $sum_percent_we < 91){
              echo '<th width="10%" bgcolor ="#33cc00" >';
              echo $sum_percent_we;
              echo '</th>';
            }else if($sum_percent_we >=51 && $sum_percent_we < 71){
              echo '<th width="10%" bgcolor ="#ffffcc" >';
              echo $sum_percent_we;
              echo '</th>';
            }else if($sum_percent_we >=1 && $sum_percent_we < 51){
              echo '<th width="10%" bgcolor ="#ff3300" >';
              echo $sum_percent_we;
              echo '</th>';
            }else if($sum_percent_we < 1){
              echo '<th width="10%" bgcolor ="#ffccff" >';
              echo $sum_percent_we;
              echo '</th>';
            }
          <!--[/php]-->
        <th><!--[$sum_count_sungmen_they]--></th>
          <!--[php]-->
            if($sum_percent_they >=91 && $sum_percent_they <= 100){
              echo '<th width="10%" bgcolor ="#0099ff" >';
              echo $sum_percent_they;
              echo '</th>';
            }else if($sum_percent_they >=71 && $sum_percent_they < 91){
              echo '<th width="10%" bgcolor ="#33cc00" >';
              echo $sum_percent_they;
              echo '</th>';
            }else if($sum_percent_they >=51 && $sum_percent_they < 71){
              echo '<th width="10%" bgcolor ="#ffffcc" >';
              echo $sum_percent_they;
              echo '</th>';
            }else if($sum_percent_they >=1 && $sum_percent_they < 51){
              echo '<th width="10%" bgcolor ="#ff3300" >';
              echo $sum_percent_they;
              echo '</th>';
            }else if($sum_percent_they < 1){
              echo '<th width="10%" bgcolor ="#ffccff" >';
              echo $sum_percent_they;
              echo '</th>';
            }
          <!--[/php]-->
        <th><!--[$sum_all_count_sungmen_unknown]--></th>
          <!--[php]-->
            if($sum_percent_all_count_sungmen_unknown >=91 && $sum_percent_all_count_sungmen_unknown <= 100){
              echo '<th width="10%" bgcolor ="#0099ff" >';
              echo $sum_percent_all_count_sungmen_unknown;
              echo '</th>';
            }else if($sum_percent_all_count_sungmen_unknown >=71 && $sum_percent_all_count_sungmen_unknown < 91){
              echo '<th width="10%" bgcolor ="#33cc00" >';
              echo $sum_percent_all_count_sungmen_unknown;
              echo '</th>';
            }else if($sum_percent_all_count_sungmen_unknown >=51 && $sum_percent_all_count_sungmen_unknown < 71){
              echo '<th width="10%" bgcolor ="#ffffcc" >';
              echo $sum_percent_all_count_sungmen_unknown;
              echo '</th>';
            }else if($sum_percent_all_count_sungmen_unknown >=1 && $sum_percent_all_count_sungmen_unknown < 51){
              echo '<th width="10%" bgcolor ="#ff3300" >';
              echo $sum_percent_all_count_sungmen_unknown;
              echo '</th>';
            }else if($sum_percent_all_count_sungmen_unknown < 1){
              echo '<th width="10%" bgcolor ="#ffccff" >';
              echo $sum_percent_all_count_sungmen_unknown;
              echo '</th>';
            }
          <!--[/php]-->
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td colspan="2">
          <table width="100%">
            <tr>
              <td bgcolor="#0099ff" width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td width="95%">&nbsp;ระดับคะแนน (91% - 100%)</td> 
            </tr>
          </table>
        </td>
        <td colspan="2">
          <table width="100%">
            <tr>
              <td bgcolor="#ff3300" width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td width="95%">&nbsp;ระดับคะแนน (1% - 50%)</td> 
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td colspan="2">
          <table width="100%">
            <tr>
              <td bgcolor="#33cc00" width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td width="95%">&nbsp;ระดับคะแนน (71% - 90s%)</td> 
            </tr>
          </table>
        </td>
        <td colspan="2">
          <table width="100%">
            <tr>
              <td bgcolor="#ffccff" width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td width="95%">&nbsp;ระดับคะแนน (0%)</td> 
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td colspan="2">
          <table width="100%">
            <tr>
              <td bgcolor="#ffffcc" width="5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td width="95%">&nbsp;ระดับคะแนน (51% - 70%)</td> 
            </tr>
          </table>
        </td>
        <td colspan="2">
          &nbsp;
        </td>
      </tr>
    </table>
<br>
  <!--[/if]-->